<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ page import="dto.TcmDetailDto" %>
<%@ page import="pojo.TcmRelation" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>细节查询</title>
<style type="text/css">
	table {
		border-collapse: collapse;
	}
</style>
</head>
<script>
	function backToTcmList() {
		location="/TcmSystem/TcmServlet?action=list&curPage=1";
	}
</script>

<body>
<%
	TcmDetailDto tcmDetailDto= (TcmDetailDto)request.getAttribute("detail");
	List<TcmRelation> tcmRelationList=tcmDetailDto.getTcmRelationList();
%>

<h1 align="center">药品细节</h1>
<table border="2" width="80%" align="center">
	<tr>
		<td width="5%">编号</td>
		<td width="5%">中药名</td>
		<td width="5%">别名</td>
		<td width="5%">归属类型</td>
		<td>本经原文</td>
		<td>主治</td>
		<td>产地</td>
		<td>性味</td>
		<td>用量</td>
		<td>禁忌</td>
		<td>炮制方法</td>
		<td>其他</td>
	</tr>
	<tr>
		<td><%=tcmDetailDto.getNumber() %> </td>
		<td><%=tcmDetailDto.getName()   %> </td>
		<td><%=tcmDetailDto.getAlias()    %> </td>
		<td><%if (1==tcmDetailDto.getType()){%>
			<%="上经"%>
			<%}else if (2==tcmDetailDto.getType()){%>
			<%="中经"%>
			<%}else if (3==tcmDetailDto.getType()){%>
			<%="下经"%>
			<%}else if (4==tcmDetailDto.getType()){%>
			<%="增补"%>
			<%}else{%>
			<%="其他"%>
			<%}%>
		</td>
		<td><%=tcmDetailDto.getBjyw()  %></td>
		<td><%=tcmDetailDto.getZhuzhi()  %></td>
		<td><%=tcmDetailDto.getXingwei()  %></td>
		<td><%=tcmDetailDto.getChandi()  %></td>
		<td><%=tcmDetailDto.getDosage()  %></td>
		<td><%=tcmDetailDto.getTaboo()  %></td>
		<td><%=tcmDetailDto.getProcessing()  %></td>
		<td><%=tcmDetailDto.getNote()  %></td>
	</tr>
</table >
<br/>
	<table cellspacing="10px" cellpadding="10px" width="80%" border="2" align="center">
	<tr>
		<td align="center">心得</td>
		<td align="center" width="15%">出处</td>
	</tr>
	<%
		for(TcmRelation relation:tcmRelationList){	%>
	<tr>

		<td><%=relation.getContent()    %> </td>
		<td><%=relation.getProvenance()    %> </td>

	</tr>
	<%} %>
 	</table>
<div align="center">
	<input align="center" type="button" value="返回" onclick="backToTcmList();"/>
</div>

</body>
</html>